#coding:utf-8

def get_command(funcname,obj):
    if not hasattr(obj, funcname):
        return None;
    return getattr(obj, funcname);

def try_command(func,args):
    func(args);

class v :
    def showMsg(self,msg):
        print msg;

if(__name__== "__main__"):
    v1 = v();
    sm = get_command("showMsg", v1);
    try_command(sm, "test");